up: programming - HTML  
programming - HTML5 - canvasWhat links here?
include a canvas in a webpage:
<canvas id="a_canvas" width="300" height="225">


obtain a reference to the canvas to use with javascript:
var a_canvas = document.getElementById("a_canvas");
var a_context = a_canvas.getContext("2d");


draw a rectangle:
a_context.fillRect(x, y, width, height);


Canvas context properties
stylefillStyleset or return the color, gradient, or pattern used to fill the drawing
stylestrokestyleset or return the color, gradient, or pattern used to draw lines
colorshadowColorset or return the color used for shadows
colorshadowBlurset or return the level used for shadow blurring
colorshadowOffsetXset or return the offset of the shadow from the object
colorshadowOffsetY


Canvas context Methods
createLinearGradient()
createPattern()
createRadialGradient()
addColorStop()



Resources
WWW Schools - HTML Canvas Reference
MDN - HTMLCanvasElement
Dive Into HTML5 #4 Let's call it a drawing surface
programming - HTML5 - canvas
filename:programming - HTML5 - canvas
filename:programming%20%2D%20HTML5%20%2D%20canvas
last edit:October 23 2015 17:06:23 (3117 days ago)
ct = 1714983845.000000 = May 06 2024 04:24:05
ft = 1445634383.000000 = October 23 2015 17:06:23
dt = 269349462.000000